import React, {Component} from 'react';
import styles from './index.less';
import classNames from 'classnames';
import {
  List
} from 'antd';


export default class ListComponent extends Component {
  constructor(props) {

    //const style = this.props.style;

    super(props);
  }

  render() {
    let {children ,style ,className ,pagination } =this.props;
    const classContent = classNames(styles.List, {
      [className]: className,
    })

    if (pagination && !pagination.simple && !pagination.itemRender){
      pagination.itemRender = (current, type, originalElement)=>{
        if (type === 'prev') {
          return <a>{'<'}</a>;
        }
        if (type === 'next') {
          return <a>{'>'}</a>;
        }
        return originalElement;
      }

    }
    return <List  {...this.props} style={style}    className={classContent} > {children}</List>;
  }
}
ListComponent.Item = List.Item